package cn.pfz.query;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/*
封装查询条件  ， 由页面传入的条件
 */

@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class QueryObject {
    private int currentPage = 1;
    private int pageSize = 5;

    public QueryObject(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    //起始数据的编号

    public int getStart() {
        return (currentPage - 1) * pageSize;
    }
}
